<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        var a = 10;

        function fun() {

            a = "global";

        }

        console.log(a);

        //输出 ？

        var a;

        function fun(){

            a = "global";

        }

        fun();

        console.log(a);

    </script>
</head>
<body>

</body>
</html>